package com.fishery.processing.entity.vo;

import com.fishery.entity.GlobalException;
import com.fishery.entity.StatusCode;
import io.swagger.annotations.ApiModelProperty;

/**
 * @author run
 * @since 2021/3/12 20:24
 */
public class MaterialInventoryVo {

    @ApiModelProperty(value = "库存信息id")
    private String id;

    @ApiModelProperty(value = "原料id")
    private String materialId;

    @ApiModelProperty(value = "原料名称")
    private String materialName;

    @ApiModelProperty(value = "原料质量 /kg")
    private Double materialWeight;

    @ApiModelProperty(value = "所属基地id")
    private String baseId;

    @ApiModelProperty(value = "原料供应商所属基地名称")
    private String supplierBase;

    @ApiModelProperty(value = "原料供应商名称")
    private String supplierName;

    @ApiModelProperty(value = "原料供应商类型 1养殖基地、2加工厂、3冷库")
    private Integer supplierType;

    public String getBaseId() {
        return baseId;
    }

    public void setBaseId(String baseId) {
        this.baseId = baseId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMaterialId() {
        return materialId;
    }

    public void setMaterialId(String materialId) {
        this.materialId = materialId;
    }

    public String getMaterialName() {
        return materialName;
    }

    public void setMaterialName(String materialName) {
        this.materialName = materialName;
    }

    public Double getMaterialWeight() {
        return materialWeight;
    }

    public void setMaterialWeight(Double materialWeight) {
        this.materialWeight = materialWeight;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public Integer getSupplierType() {
        return supplierType;
    }

    public void setSupplierType(Integer supplierType) {
        if (supplierType == null || supplierType > 3 || supplierType < 1){
            throw new GlobalException(StatusCode.ERROR,"原料供应商类型不合法");
        }
        this.supplierType = supplierType;
    }

    public String getSupplierBase() {
        return supplierBase;
    }

    public void setSupplierBase(String supplierBase) {
        this.supplierBase = supplierBase;
    }
}
